
# write 'hello\n' to physical mem 0x17f0
# dmem starts at 0x800, so the actual dmem addr is 0x17f0-0x800=0xff0
lui x1,  0x1
addi x2, x1, 0x24    # for initial support lui and addi

xor x1, x1, x1
lui x1,  0x1

xor x2, x2, x2       # h
addi x2, x0, 0x68
sb x2, 0x7f0(x1)
xor x3, x3, x3
lb x3, 0x7f0(x1)

xor x2, x2, x2       # e
addi x2, x0, 0x65
sb x2, 0x7f0(x1)
xor x3, x3, x3
lb x3, 0x7f0(x1)

xor x2, x2, x2       # l
addi x2, x0, 0x6c
sb x2, 0x7f0(x1)
xor x3, x3, x3
lb x3, 0x7f0(x1)

xor x2, x2, x2       # l
addi x2, x0, 0x6c
sb x2, 0x7f0(x1)
xor x3, x3, x3
lb x3, 0x7f0(x1)

xor x2, x2, x2       # o
addi x2, x0, 0x6f
sb x2, 0x7f0(x1)
xor x3, x3, x3
lb x3, 0x7f0(x1)

xor x2, x2, x2       # \n
addi x2, x0, 0x0a
sb x2, 0x7f0(x1)
xor x3, x3, x3
lb x3, 0x7f0(x1)

# simulation end flag, write 1 to 0x13f1
xor x2, x2, x2
addi x2, x0, 0x01
sb x2, 0x7f2(x1)  # sim success signal
sb x2, 0x7f1(x1)  # sim end signal
